package test.marui.com.mytest.view.slideBackView;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import test.marui.com.mytest.R;
import test.marui.com.mytest.view.slideBackView.view.SlideBack;


/**
 * Created by MR on 2019/2/21.
 */
public class SlideBackViewActivity extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_slide_back_view);
        View textView = findViewById(R.id.textView);
        textView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(SlideBackViewActivity.this, SlideBackViewActivity.class);
                startActivity(intent);
                overridePendingTransition(R.anim.fade_right_in, R.anim.fade_left_out);
            }
        });

        SlideBack.create()
                .attachToActivity(this);
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        overridePendingTransition(R.anim.fade_left_in, R.anim.fade_right_out);
    }
}
